import { CoolController, BaseController, CoolUrlTag, TagTypes } from '@cool-midway/core';
import { Body, Inject, Post, Get, Query } from '@midwayjs/core';
import { GameLevelRecordEntity } from '../../entity/record'; 
import { GameLevelRecordService } from '../../service/record'; 

/**
 * game模块-游戏记录
 */
@CoolUrlTag({
  key: TagTypes.IGNORE_TOKEN,
  value: ['add','update'],
})
@CoolController({
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: GameLevelRecordEntity,
  service: GameLevelRecordService,
  pageQueryOp: {
    keyWordLikeFields: ['remark'],
    fieldEq: ['type', 'mode', 'difficulty', 'status'],
    where: async (ctx) => {
      return [
        ['a.playerId = :playerId', { playerId: ctx.query.playerId }],
      ]
    }
  }
})
export class AppGameLevelRecordController extends BaseController {
    @Inject()
    gameLevelRecordService: GameLevelRecordService;
}
